﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data.SqlClient;
using System.Linq;
using System.Web;

namespace TeamDoer.Models
{
	public class BaseService : IDisposable
	{
		protected readonly SqlConnection _cn;
		protected readonly SqlCommand _cmd;

		public BaseService()
		{
			_cn = new SqlConnection(ConfigurationManager.ConnectionStrings["TeamDoer"].ConnectionString);
			_cmd = new SqlCommand() { Connection = _cn };
		}

		public void Dispose()
		{
			if (_cn != null) _cn.Dispose();
			if (_cmd != null) _cmd.Dispose();
		}
	}
}